<template>
	<view>
		<scroll-view scroll-x="false" scroll-y="true" class="scroll-views">
			<view class="conter">
			<!-- #ifdef MP-WEIXIN -->
				<view class="" @tap="$fun.jump(`/pageA/authorization/add`)" style="display: flex;justify-content: flex-end;padding: 10rpx;">
					<view class="" @tap="$fun.jump(`/pageA/authorization/add`)">
						添加[+]
					</view>
				</view>
			<!-- #endif -->
				<!-- <view class="maxtitle">我的直营：{{pnum}};我的店员：{{pnums}} ;直营人邀请码：{{user}}</view> -->
				<view class="cent" v-if="teamone.length>0">
					<view class="list" v-for="(item,index) in  teamone" :key="item.id" @click="$fun.jump(`/pageA/authorization/add?name=编辑&id=${item.id}`,0,0)">
						<image class="myimg" :src="item.avatar" mode="widthFix"></image>
						<view class="left">
							<view class="num">
							</view>
							<view class="name">姓名 : {{item.nickname}}</view>
							<view class="name">账号 : {{item.username}}</view>
							<view class="name">类型 : {{item.level1Name}}</view>
							<view class="name">手机号 : {{item.mobile}}</view>
							<view class="name">分润比例(%) : {{item.bouns_rebate}}%</view>
						</view>
					</view>
				</view>
				<noneDate v-if="teamone.length==0">
				</noneDate>
			</view>
		</scroll-view>
	</view>
</template>

<script>
	import noneDate from '@/components/noneDate/noneDate.vue'
	export default {
		components: {
			noneDate
		},
		data() {
			return {
				teamone: [],
				pnum: '0',
				pnums: '0',
				page: 1,
				user:'',
				limit: 10
			}
		},
		onNavigationBarButtonTap(e) {
			this.$fun.jump('/pageA/authorization/add')
		},
		onReachBottom() {
			this.getTeamone(this.page, this.limit)
		},
		onLoad(options) {
			uni.setNavigationBarTitle({
				title:options.name
			})
		},
		onShow() {
			this.getTeamone(this.page, this.limit)
		},
		methods: {
			getTeamone(page, limit) {
				this.$fun.ajax.post('user/underProxy',{
					page,
					limit
				}).then(res => {
					if(res.code==1){
						//console.log(res.data)
						//console.log(res.data.length)
						if (res.data.length!=0) {
							this.teamone.push(...res.data);
							this.page++
						} else {
							if (this.page != 1) {
								this.$msg('没有更多数据了...')
							}
						}
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		background: #f5f5f5;
	}

	.conter {

		padding-top: 20upx;
		// height: auto;

		.maxtitle {
			width: 696upx;
			margin: 0 auto;
			font-size: 26upx;
			color: #0066FF;
		}

		.cent {
			width: 696upx;
			margin: 0 auto;

			.list {
				width: 696upx;
				background: #fff;
				border-radius: 20upx;
				margin-top: 20upx;
				display: flex;
				padding: 38upx 17upx 45upx 20upx;
				box-sizing: border-box;
				align-items: center;
				.myimg {
					width: 100upx;
					height: 100upx;
					margin-right: 15upx;
					border-radius: 100upx;
				}

				.left {
					margin-left: 30rpx;

					.num {
						display: flex;
						font-size: 24upx;
						color: #333333;

						.tel {
							width: 34upx;
							height: 34upx;
							margin-left: 10upx;
						}
					}

					.name {
						font-size: 30upx;
						margin-top: 5upx;
						color: #666666;
					}

					.data {
						font-size: 30upx;
						margin-top: 5upx;
						color: #999999;
					}
				}

				.right {
					width: 285upx;
					margin-left: 10upx;
					text-align: right;

					.vip {
						height: 43upx;

						text {
							font-size: 22upx;
							border: 1upx solid #0066FF;
							color: #0066FF;
							padding: 0 13upx;
							border-radius: 5upx;
						}
					}

					.next {
						font-size: 26upx;
						color: #0066FF;
					}

					.title {
						font-size: 26upx;
						color: #666666;
					}
				}
			}
		}
	}
</style>
